

var mongoose = require("mongoose")

var {Schema,model} = mongoose;

var user_schema = new Schema({
    username:String,
    password:String,
    mobile:String,
    confirm_password:String,
    age:Number,
    word:String,
    address:String,
    time:Date
})

exports.UserModel = model("users",user_schema)


var movie_schema = new Schema({
    "genres": Array,
    "casts": Array,
    "directors": Array,
    "rating": Object,
    "title":String,
    "collect_count": Number,
    "original_title":String,
    "subtype": String,
    "year":String,
    "images": Object,
    "alt": String,
    "id": String
})

exports.MvModel = model('movies',movie_schema)



// 评论 集合的  数据结构 
var comment_schema = new Schema({
    title:String,
    content:String,
    time:Number,
    username:String,
    mid:String,
    movie:Object
})

exports.Comment = model('comment1',comment_schema)


//相册模块数据结构

var Album_schema = new Schema({
    username:String,
    albumname:String,
    picturenum:Number,
    time:Date,
})

exports.Album = model('album1',Album_schema)


//图片模块数据结构

var Picture_schema = new Schema({
    aid:String, // aid 获取 相册模块数据结构 中的 _id
    imgs:String,
    time:Date,
})

exports.Picture = model('picture1',Picture_schema)